#ifndef MESSAGE_QUEUE_H
#define MESSAGE_QUEUE_H
#include <queue>
#include "GameMessage.h"
#include "Singleton.h"
#include "Mutex.h"

class MessageQueue : public NonCopyable
{
public:
	void AddToQueue(GameMessage* gm);
	void Update();
private:
	struct GMLessThan
	{
		bool operator()(GameMessage*, GameMessage*);
	};
	typedef std::priority_queue<GameMessage*, std::vector<GameMessage*>,GMLessThan> Q;
	Q m_Queue;

	Mutex m_Mutex;
};
typedef Singleton<MessageQueue> TheMessageQueue;

#endif